<?php
 /**
 +------------------------------------------------------------------------------
 * 测试RefectionClass api反射
 +------------------------------------------------------------------------------
 * @Version  2.2
 * @Author   WangXian
 * @E-mail    admin@loopx.cn
 * @package  ephp
 * @FileName  test.RefectionClass.php
 * @Creation  date 2010-10-17
 * @Modified  date 2010-10-17
 +------------------------------------------------------------------------------
 */

class c
{
	public $abc = 'public string test !';
	public function test1($str = 'test1')
	{ echo $str."<br />";}
	
	public function test2()
	{ echo $this->abc."<br />";}
}

#ReflectionClass
//$rc = new ReflectionClass('c');
////var_dump($rc);
//$instance = $rc->newInstance();
//
//$mothod1 = $rc->getMethod('test1');
//$mothod2 = $rc->getMethod('test2');
//
//$mothod1->invoke($instance);
//$mothod2->invoke($instance);

#ReflectionMethod
$r = new ReflectionMethod('c', 'test1' );
$r->invoke(new c() );
$r = new ReflectionMethod('c', 'test2' );
$r->invoke(new c() );






